﻿using System.Collections.Generic;

namespace IterationLife.Extensions.Dtos
{
    /// <summary>
    /// 范围数据
    /// </summary>
    public class RangeData<TData>
    {

        /// <summary>
        /// 初始化范围数据
        /// </summary>
        public RangeData()
        {
            Datas = new List<TData>();
            LatestId = null;
            EarliestId = null;
        }

        /// <summary>
        /// 初始化范围数据
        /// </summary>
        /// <param name="datas">数据</param>
        /// <param name="latestId">下一个编号</param>
        /// <param name="earliestId">上一个编号</param>
        public RangeData(IEnumerable<TData> datas, string latestId, string earliestId)
        {
            Datas = datas;
            LatestId = latestId;
            EarliestId = earliestId;
        }

        /// <summary>
        /// 数据
        /// </summary>
        public IEnumerable<TData> Datas { get; set; }

        /// <summary>
        /// 下一个编号
        /// </summary>
        public string LatestId { get; set; }

        /// <summary>
        /// 上一个编号
        /// </summary>
        public string EarliestId { get; set; }

    }
}
